package org.iabako.shared.querydefinition.columndefinition;

import org.iabako.client.tools.Messages;
import org.iabako.shared.querydefinition.dto.QueryResultValueType;

import java.io.Serializable;

/**
 * Created by jose on 23/03/15.
 */
public enum UserColumnEnum implements ColumnDefinition, Serializable {
    name("concat(user.firstName, concat(' ',user.lastName))", null, "result_table_user_name", "columnMplus smalltable columnleftalign", null, null, null, QueryResultValueType.STRING),
    email("user.email", null, "result_table_user_package", "columnMplus smalltable", null, null, null, QueryResultValueType.ENUM),
    limitedVisibility("user.limitedVisibility", null, "result_table_user_limited_visibility", "columnS smalltable columncenteralign", null, null, null, QueryResultValueType.BOOLEAN),
    iabakoPackage("userCredit.iabakoPackage", null, "result_table_user_package", "columnS smalltable", null, null, null, QueryResultValueType.ENUM),
    expirationDate("userCredit.expirationDate", null, "result_table_user_expiration_date", "columnSplus smalltable", null, null, null, QueryResultValueType.ENUM),

    //To filter
    id("user.id", null, null, null, null, null, null, null),
    enterprise("user.enterprise", null, null, null, null, null, null, null),
    active("user.active", null, null, null, null, null, null, null);

    private String hqlDefinition;
    private String hqlJoin;
    private String labelKey;
    private String className;
    private String iconClassName;
    private String iconClassNameEmpty;
    private String textEmpty;
    private QueryResultValueType queryResultValueType;

    UserColumnEnum(String hqlDefinition, String hqlJoin, String labelKey, String className, String iconClassName,
                   String iconClassNameEmpty, String textEmpty, QueryResultValueType queryResultValueType) {
        this.hqlDefinition = hqlDefinition;
        this.hqlJoin = hqlJoin;
        this.labelKey = labelKey;
        this.className = className;
        this.iconClassName = iconClassName;
        this.iconClassNameEmpty = iconClassNameEmpty;
        this.textEmpty = textEmpty;
        this.queryResultValueType = queryResultValueType;
    }

    public String getHqlDefinition() {
        return hqlDefinition;
    }

    public String getHqlJoin() {
        return hqlJoin;
    }

    public String getLabel() {
        return Messages.getLabel(labelKey);
    }

    public String getLabelKey() {
        return labelKey;
    }

    public QueryResultValueType getQueryResultValueType() {
        return queryResultValueType;
    }

    public int getExcelColumnWidth() {
        return 0;
    }

    public String getClassName() {
        return className;
    }

    public String getIconClassName() {
        return iconClassName;
    }

    public boolean isOnlyInExcelExport() {
        return false;
    }

    public String getIconClassNameEmpty() {
        return iconClassNameEmpty;
    }

    public String getTextEmpty() {
        return textEmpty;
    }
}
